package 蓝桥真题;
import java.io.*;
import java.util.*;
public class 奇数倍数_1{
       static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
       final static int N=100010;
       
       static void scan()throws Exception{
              
       }
       public static void main(String[]args)throws Exception{
              int idx=1;
              while(true){
                   long t=2019L*idx;
                   boolean flag=true;
                   while(t>0){
                        if(((t%10)%2)==0){
                           flag=false;
                           break;
                        }
                        t/=10;
                   }
                   if(flag){
                      System.out.print(2019L*idx);
                      break;
                   }
                   idx++;
              }
       }
}